home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 12546 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.8 KB  |  70 lines

  1. Path: news.uni-hohenheim.de!news
  2. From: roberto canales <rcanales@sag.es>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: bitmaps with visual c++ help!
  5. Date: Wed, 20 Mar 1996 16:00:38 -0800
  6. Organization: Rechenzentrum Universitaet Hohenheim
  7. Message-ID: <31509C26.230C@sag.es>
  8. References: <4in47t$pmn@korfu.igd.fhg.de>
  9. NNTP-Posting-Host: 193.127.46.178
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0 (Win16; I)
  14.  
  15. Nader El-Azabi (Jian Zhang) wrote:
  16. > Hi everybody,
  17. > I'm new to this visual c++ windows stuff. I hope you can
  18. > help me with this: I created an app wizzard application
  19. > with form view option. I got a row of buttons and wish
  20. > to display a bitmap I created with corel draw, on the
  21. > main window  when pushing a button.
  22. > Is it possible to place a bitmap (gif file, bmp file) so it is visible
  23. > first the application is being executed ?
  24. > thanks, 
  25. You can display bitmap using CBitmapButton class.
  26. You must paint a button with AppStudio with "Owner Draw" style.
  27. You must paint 4 bitmaps with the name of the caption and suffix U,D,F,X
  28. See CBitmapButton overview
  29.  
  30. Exemple: 
  31.  
  32.     if the caption is BOTON
  33.     the bitmap must be "BOTONU","BOTOND","BOTONX","BOTONF"
  34.  
  35. In the prototipe of the class declare a CBitmapButton object
  36. and in OnInitialUpdate of your view use AutoLoad
  37.  
  38.  
  39.  
  40.  
  41. class CBaseView : public CFormView
  42. {
  43. --------
  44.     CBitmapButton ante;
  45.     CBitmapButton sig;
  46.     
  47.     virtual void OnInitialUpdate();
  48.     .......
  49. };
  50.  
  51.  
  52.  
  53. void CBaseView::OnInitialUpdate()
  54. {
  55.     ante.AutoLoad(IDC_ANTERIOR,this);
  56.     sig.AutoLoad(IDC_SIGUIENTE,this);
  57.     UpdateData(FALSE);
  58. }
  59.  
  60. You can see c:\msvc\mfc\sample\speakn exemple
  61.  
  62. If you want display a bitmap of disk see
  63. c:\msvc\mfc\sample\diblook exemple
  64.  
  65. Excuse my english.
  66.  
  67. Roberto Canales
  68. rcanales@sag.es
  69.